package com.yanqu.road.server.cmd.cross.tradewar;

import com.yanqu.road.pb.cross.tradewar.CrossTradeWarProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_TRADE_WAR_QUERY_ENEMY_PATRONS_NOTIFY, desc = "跨服商战查询对手门客信息通知")
public class CrossTradeWarQueryEnemyPatronsNotifyCmd extends AbstractCommand {

	private CrossTradeWarProto.CrossTradeWarCrossQueryEnemyPatronsRespMsg reqMsg;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		reqMsg = CrossTradeWarProto.CrossTradeWarCrossQueryEnemyPatronsRespMsg.parseFrom(packet.getBytes());
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CrossTradeWarProto.CrossTradeWarQueryEnemyPatronsRespMsg.Builder respMsg = CrossTradeWarProto.CrossTradeWarQueryEnemyPatronsRespMsg.newBuilder();
		respMsg.setRet(reqMsg.getRet());
		respMsg.addAllEnemyPatronsList(reqMsg.getEnemyPatronsListList());
		respMsg.setEnemyPatronsAbility(reqMsg.getEnemyPatronsAbility());
		player.sendPacket(Protocol.U_CROSS_TRADE_WAR_QUERY_ENEMY_PATRONS, respMsg);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
